package com.kuang.gulimall.thirdtools.controller;

import org.springframework.web.bind.annotation.RestController;


@RestController
public class CosController {

    //腾讯的对象存储，没玩明白，等有机会再玩
//    @RequestMapping("/cos/policy")
//    public R policy(){
//        // 初始化永久密钥信息
//
//        String secretId = "AKIDhsnaT9NSyFoVN1lhjallYDcEchWAqGis";
//        String secretKey = "DKJFv9CJAqJM9d7MThiVqwwoQwGNFm5D";
//        COSCredentials cred = new BasicCOSCredentials(secretId, secretKey);
//        COSSigner signer = new COSSigner();
//        //设置过期时间为1个小时
//        Date expiredTime = new Date(System.currentTimeMillis() + 3600L * 1000L);
//        // 要签名的 key, 生成的签名只能用于对应此 key 的上传
//        String key = "123";
//        String sign = signer.buildAuthorizationStr(HttpMethodName.PUT, key, cred, expiredTime);
//        Map<String,String> map = new HashMap<>();
//        map.put("sign",sign);
//        System.out.println(map);
//        return R.ok().put("data",sign);
//    }
}
